{extend name="common@admin/main" /}
{block name="content"}
<div id="content">
    <div class="page-header">
        <div class="container-fluid">
            <div class="pull-right">
                <a href="" data-toggle="tooltip" title="新增" class="btn btn-primary">
                    <i class="fa fa-plus"></i>
                </a>

                <button type="button" data-toggle="tooltip" title="删除" class="btn btn-danger" onclick="confirm('确认？') ? $('#form-list').submit() : false;">
                    <i class="fa fa-trash-o"></i>
                </button>
            </div>
            <h1>操作节点</h1>
            <ul class="breadcrumb">
                <li>
                    <a href="">首页</a>
                </li>
                <li>
                    <a href="#">操作节点列表</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="container-fluid">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <i class="fa fa-list"></i>
                    操作节点列表
                </h3>
            </div>
            <div class="panel-body">
                <form action="" method="get">
                    <div class="well">
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="form-group">
                                    <label class="control-label" for="input-keyword">关键字</label>
                                    <input name="keyword" value="" placeholder="品牌名称" id="input-keyword" class="form-control" type="text">
                                </div>
                            </div>
                        </div>
                        <div class="row"><!-- div.row>div.col-sm-12 -->
                            <div class="col-sm-12">
                                <button type="submit" id="button-filter" class="btn btn-primary pull-right">
                                    <i class="fa fa-search"></i>
                                    筛选
                                </button>
                            </div>
                        </div>
                    </div>
                </form>

                <form action="" method="post" enctype="multipart/form-data" id="form-list">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <td style="width: 1px;" class="text-center">
                                    <input type="checkbox"/>
                                </td>

                                <td class="text-left">
                                    <a href="" class="">ID</a>
                                </td>
                                <td class="text-left">
                                    <a href="" class="">节点名</a>
                                </td>
                                <td class="text-left">
                                    <a href="" class="">标题</a>
                                </td>
                                <td class="text-left">
                                    <a href="javascript:;" class="">状态</a>
                                </td>
                                <td class="text-left">
                                    <a href="javascript:;" class="">备注</a>
                                </td>
                                <td class="text-left">
                                    <a href="" class="">顺序</a>
                                </td>
                                <td class="text-left">
                                    <a href="" class="">上级ID</a>
                                </td>
                                <td class="text-left">
                                    <a href="" class="">层级</a>
                                </td>
                                <td class="text-right">操作</td>
                            </tr>
                            </thead>
                            <tbody class="tbody">
                            </tbody>
                        </table>
                    </div>
                </form>

                <div class="row">

                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="title"}
<title>动作节点列表</title>
{/block}

{block name="appendJS"}
<script>
    var node={$role_list},
        LEVEL={$LEVEL},
        tbody=$('.tbody');
    console.log(node)
    $.each(node,function(key,val){
        var tr=$('<tr>');
        tr.append($('<td/>',{class:"text-center"}).append(
            $('<input/>',{type:"checkbox",name:"selected[]",value:val.id })
        ))
        tr.append($('<td>',{class:"text-left"}).html(val.id))
        tr.append($('<td>',{class:"text-left"}).html(val.name))
        tr.append($('<td>',{class:"text-left"}).html(val.title))
        tr.append($('<td>',{class:"text-left"}).html(val.status))
        tr.append($('<td>',{class:"text-left"}).html(val.remark))
        tr.append($('<td>',{class:"text-left"}).html(val.sort))
        tr.append($('<td>',{class:"text-left"}).html(val.pid))

        tr.append($('<td>',{class:"text-left"}).html(LEVEL[val.level]))
        tr.append($('<td>',{class:"text-right"}).append($('<a/>',{
                                href:"",
                                title:"编辑",
                                class:"btn btn-primary"
                            }).append($('<i/>',{class:"fa fa-pencil"}))
        ))
        tbody.append(tr)
    })
</script>
{/block}

